import Main from '../views/Main.vue'

// import Login from '../views/Login.vue'
// import Page404 from '../views/Page404.vue'
import ArticlePublish from '../views/article/articlePublish/ArticlePublish'

// 登录页面
// export const loginRouter = {
//   path: '/login',
//   name: 'login',
//   meta: {
//     title: '老王笔记-登录'
//   },
//   component: Login
// }

// 404页面
// export const page404 = {
//   path: '/*',
//   name: 'error-404',
//   meta: {
//     title: '404-页面不存在'
//   },
//   component: Page404
// }

// 作为子页面，但是不显示左侧菜单
export const otherRouter = {
  path: '/',
  name: 'otherRouter',
  redirect: 'home',
  component: Main,
  children: [
    {
      path: 'home',
      title: '首页'
    }, {
      path: 'ownspace',
      title: '个人中心'
    }
  ]
};

// 作为子页面，显示在左侧菜单
export const appRouter = [
  {
    path: '/article',
    name: 'article',
    title: '文章',
    component: Main,
    children: [
      {
        path: 'articlePublish',
        title: '文章发表',
        name: 'articlePublish',
        component: ArticlePublish
      }
    ]
  }
]

export const routers = [
  // loginRouter,
  // otherRouter,
  ...appRouter
]

